<?php

	// +----------------------------------------------------------------------
	// | 快速创建代码
	// +----------------------------------------------------------------------
	// | Copyright (c) 2015-2024 http://www.yicmf.com, All rights reserved.
	// +----------------------------------------------------------------------
	// | Author: 微尘 <yicmf@qq.com>
	// +----------------------------------------------------------------------

	namespace app\common\command;

	use app\event\index\Share as ShareEvent;
    use app\model\ucenter\User as UserModel;
    use think\console\Command;
	use think\console\Input;
	use think\console\input\Argument;
	use think\console\input\Option;
	use think\console\Output;
	use think\facade\Config;

	class Build extends Command
	{
		protected function configure()
		{
			$this->setName('builder')
				->addArgument('name', Argument::OPTIONAL, "参数名称")
				->addOption('value', null, Option::VALUE_REQUIRED, '配置值')
				->setDescription('Installation Program');
		}

		protected function execute(Input $input, Output $output)
		{
            $value = trim($input->getOption('value'));
            ini_set('memory_limit', '512M');

            set_time_limit(1000);
            $event = new ShareEvent();
            $data = $event->autoBuild();

//            if (!isset($this->db['user'])) {
//                fwrite(STDOUT, '请输入数据库配名' . PHP_EOL);
//                $answer = strtolower(trim(fread(STDIN, 1024), PHP_EOL));
//                fwrite(STDOUT, '请输入数据库密码' . PHP_EOL);
//                $pass = strtolower(trim(fread(STDIN, 1024), PHP_EOL));
//                $output->writeln("<info>{$answer}".$pass."</info>");
//            }
            $output->writeln($data['']);
        }


	}